package com.runjian.rundo.iot.agent.business.control.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;

import com.runjian.rundo.iot.agent.business.control.consts.ControlConst;

import lombok.Getter;
import lombok.Setter;

/**
 * 控制配置属性
 *
 * @author CaoQingHua
 */
@Setter
@Getter
@ConditionalOnProperty(value = ControlConst.NETWORK_CONTROL_ENABLED, havingValue = "true")
@ConfigurationProperties(ControlConst.NETWORK_CONTROL)
public class ControlConfigurationProperties {

    /**
     * 控制下发时间与现在时间相关的最大时间间差（秒)
     */
    private Long dateBetweenMaxSeconds = 5L;

    /**
     * 控制超时的秒数
     */
    private Long timeout = 10L;

    /**
     * 数据上报的Topi
     */
    @Value("${spring.kafka.topics.controlCallBack}")
    private String controlCallbackTopic;
}
